/*
Copyright (c) 2010 J�r�my "Capitaine Mousse" barbe (jeremybarbe@capitaine-mousse.fr)

SnippIt is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

$(function(){
    $('#enregistrer').click(function(){
        var db = getDB();
        
        var nom = addslashes($('#nom').val());

        if(nom != ""){
            var test = db.execute('INSERT INTO table_categorie(id_categorie, nom_categorie) VALUES(NULL, "'+nom+'")');
            
            Titanium.UI.getCurrentWindow().close();
        }
        
        return false;
    });
});